package subject.trees;

/**
 * 给你一棵二叉树的根节点 root ，翻转这棵二叉树，并返回其根节点。
 */
public class invertTree {
    public static void main(String[] args) {
        TreeNode root = new TreeNode(1);

        TreeNode left = root.left;
        TreeNode right = root.right;

    }

    public static TreeNode swap(TreeNode root){
        if(root == null){
            return null;
        }

        TreeNode left = swap(root.left);
        TreeNode right = swap(root.right);

        root.left = right;
        root.right = left;

        return root;
    }
}
